<template>
  <div class="OtherChat">
    <div class="other_user">
      <div class="time">{{ time }}</div>
      <div class="name">{{ name }}</div>
      <div class="user_main">
        <div class="avatar_warp">
          <el-avatar :size="50" shape="circle" :src="avatar" />
        </div>
        <div class="triangle_left"></div>
        <div class="user_message" v-html="con">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "customer",
  props: {
    time: {
      type: String,
      default: "",
    },
    name: {
      type: String,
      default: "",
    },
    avatar: {
      type: String,
      default: "",
    },
    con: {
      type: String,
      default: "",
    },
  },
};
</script>

<style scoped>
.time {
  text-align: center;
  color: #9a9a9a;
  padding-bottom: 2px;
}

.other_user {
  padding-bottom: 30px;
}

.user_main {
  display: flex;
  justify-content: flex-start;   
  align-items: flex-start;
  /* 调整为flex-start，使内容顶部对齐 */
}

.user_message {
  padding: 10px 15px;
  /* 减少内边距 */
  border-radius: 20px;
  color: #000;
  background-color: #ededed;
  /* max-width: 60%; /* 可以根据需要移除或调整 */
  line-height: 1.5;
  /* 调整行高 */
  font-size: 14px;
  /* 设置合适的字体大小 */
  word-wrap: break-word;
  word-break: break-all;
  overflow: hidden;
}

.triangle_left {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  /* 调整三角形大小以匹配消息框 */
  margin-left: 10px;
  /* 调整间距 */
  border-right: 15px solid #ededed;
  border-bottom: 10px solid transparent;
}
</style>